/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ar.republicagroup.gestion.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author DIEGOALV
 */
@Entity
@Table(name = "calendario_bancario")
public class CalendarioBancario implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "calendario_id")
    private Integer calendarioId;
    @Basic(optional = false)
    @Column(name = "fecha_feriado")
    @Temporal(TemporalType.DATE)
    private Date fechaFeriado;
    @Column(name = "motivo")
    private String motivo;
    @Basic(optional = false)
    @Column(name = "vigente")
    private boolean vigente;

    public CalendarioBancario() {
    }

    public CalendarioBancario(Integer calendarioId) {
        this.calendarioId = calendarioId;
    }

    public CalendarioBancario(Integer calendarioId, Date fechaFeriado, boolean vigente) {
        this.calendarioId = calendarioId;
        this.fechaFeriado = fechaFeriado;
        this.vigente = vigente;
    }

    public Integer getCalendarioId() {
        return calendarioId;
    }

    public void setCalendarioId(Integer calendarioId) {
        this.calendarioId = calendarioId;
    }

    public Date getFechaFeriado() {
        return fechaFeriado;
    }

    public void setFechaFeriado(Date fechaFeriado) {
        this.fechaFeriado = fechaFeriado;
    }

    public String getMotivo() {
        return motivo;
    }

    public void setMotivo(String motivo) {
        this.motivo = motivo;
    }

    public boolean getVigente() {
        return vigente;
    }

    public void setVigente(boolean vigente) {
        this.vigente = vigente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (calendarioId != null ? calendarioId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CalendarioBancario)) {
            return false;
        }
        CalendarioBancario other = (CalendarioBancario) object;
        if ((this.calendarioId == null && other.calendarioId != null) || (this.calendarioId != null && !this.calendarioId.equals(other.calendarioId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return getFechaFeriado().toString();
    }
    
}
